<{layout name="admin/layout/default" /}>
<div id="role" data-page="role/list" v-cloak>
    <div class="row">
        <div class="col-lg-12">
            <a v-show="search" class="btn btn-primary" href="<{:url('admin/role/list')}>">显示所有</a>
            <a class="btn btn-default" href="<{:url('admin/role/edit')}>">添加角色</a>
        </div>
    </div>

    <hr />

    <div class="row">
        <div class="col-lg-3">
            <div class="form-group col-lg-12" style="padding: 0;">
                <select class="form-control" v-model="status">
                    <option value="0">状态</option>
                    <option value="1">启用</option>
                    <option value="2">禁用</option>
                </select>
            </div>
        </div>
        <div class="col-lg-4 col-lg-offset-5" style="margin-bottom:10px;">
            <div class="input-group custom-search-form col-lg-12">
                <input type="text" class="form-control" placeholder="name" v-model="search">
                <span class="input-group-btn">
                    <button class="btn btn-default" type="button" style="background-color: #337ab7;border-color: #2e6da4;color: #fff;" @click="search_jump()">
                        查询
                    </button>
                </span>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="table-responsive">
                <table width="100%" class="table-borbox table table-striped table-bordered table-hover dataTable no-footer dtr-inline" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                    <thead>
                    <tr>
                        <th class="text-center">ID</th>
                        <th class="text-center">角色</th>
                        <th class="text-center">标识</th>
                        <th class="text-center">状态</th>
                        <th class="text-center">更新时间</th>
                        <th class="text-center">创建时间</th>
                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody class="text-center">
                    <tr v-if="data" v-for="data in pageData.data" style="cursor: pointer;">
                        <td>${data.id}</td>
                        <td>${data.name}</td>
                        <td>${data.slug}</td>
                        <td>${data.status}</td>
                        <td>${data.updated_at}</td>
                        <td>${data.created_at}</td>
                        <td>
                            <a class="btn btn-default" :href="edit_auth_url + '?id=' + data.id">权限</a>
                            <a class="btn btn-default" :href="edit_role_url + '?id=' + data.id">编辑</a>
                            <a class="btn btn-danger" @click="delRecord(data.id)">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <{include file="admin/pagination" /}>
        </div>
    </div>
</div>
